<link rel="stylesheet" href="__PUBLIC__/icon/iconfont.css">
<style>
.menu_li {
    height: 80px;
    line-height: 80px;
    font-size: 16px;
    width: 80px;
    text-align: center;
    cursor: pointer;
}

.menu_li:hover {
    background: #cde5f7
}

.menu_li i {
    color: #666;
    font-size: 40px
}

.menu_li i:hover {
    color: #fff;
    font-weight: bold
}

.usermenu_menu {
    padding: 0;
    background: #ddedfa;
    /*padding:6px;*/
}

.active {
    background-color: #47a3da;
}
</style>
<div id="sidebar" style="position: fixed;width:80px;top:50px;">
    <ul class="usermenu_menu">
        <li class="menu_li" page_code=""><i class="iconfont icon-xing "></i></li>
        <li class="menu_li" page_code="userlist"><i class="iconfont icon-ren"></i></li>
        <li class="menu_li" page_code="img_manage"><i class="iconfont icon-image"></i></li>
        <li class="menu_li" page_code="photo"><i class="iconfont icon-xiangce"></i></li>
        <li class="menu_li" page_code="setup"><i class="iconfont icon-peizhi"></i></li>
    </ul>
</div>
<div id="page_code-content" class="page_code-content row" style="margin:0 0 0 80px">
</div>

<script src="__PUBLIC__/home/js/app.js"></script>
<script>
var Think = {
    "APP": '__APP__',
    "URL": '__URL__',
    "ROOT": '__ROOT__',
    "PUBLIC": '__PUBLIC__'
};
$(function() {

    var url_code = localStorage.getItem("user_url");

    if (url_code != "") {

        $(".usermenu_menu>li").each(function(index) {

            var type = $(this).attr('page_code');
            if (type == url_code) {
                $(this).addClass('active');
                repeat_list(url_code);
            }
        });

    }
})

// 用户中心菜单栏js
$(".usermenu_menu>li").on("click", function() {

    var gObj = $(this);
    $(".usermenu_menu>li").removeClass('active');
    gObj.addClass('active');
    page_code = gObj.attr("page_code");

    repeat_list(page_code);
});
var wh = $(window).height();
$(".usermenu_menu").css("height", wh - 50);

var wh = $(window).height();
$(".usermenu_menu").css("height", wh - 50);





function repeat_list(page_code) {
    var url = "{:U('Usercenter/index',array('code'=>'page_code'))}";
    url = url.replace('page_code', page_code);
    var url = "{:U('Usercenter/index',array('code'=>'page'))}";
    url = url.replace('page', page_code);


    loadHtmlData("#page_code-content", url)
    // $.ajax({
    //     // url:"{:U(Usercenter/index,array('code'=>'userlist'))}",
    //     // url:Think.APP+"/Usercenter/index/code/"+page+"{$Think.config.URL_HTML_SUFFIX}",
    //     url: url,
    //     type: "get",
    //     data: {
    //         page_codesize: 8
    //     },
    //     success: function(data) {
    //         // localStorage.removeItem("user_url");

    //         // $("#page_code-content").
    //         $("#page_code-content").html(data);
    //     },
    //     error: function() {
    //         console.log("网络错误")
    //             /* Act on the event */
    //     }
    // })

}
</script>
